
Ext.define("OrderConvert.view.convert.ConvertGrid",{
    extend: "Ext.grid.Panel",
    alias : 'widget.convertgrid',


    bind: '{convertStore}',
    requires: [
        "OrderConvert.view.convert.ConvertGridController",
        "OrderConvert.view.convert.ConvertGridModel"
    ],

    controller: "convert-convertgrid",
    viewModel: {
        type: "convert-convertgrid"
    },

    tbar : {
        xtype : 'toolbar',
        items : [{
            xtype : 'button',
            iconCls : 'x-fa fa-plus',
            text : '新建规则',
            handler : 'addConvert'
        },'-',{
            text : '编辑规则',
            iconCls : 'x-fa fa-pencil-square-o',
            handler : 'editRule'
        },'-',{
            text : '设定规则热区',
            iconCls : 'x-fa fa-pencil-square-o',
            handler : 'editRuleArea'
        },'->',{
            text : '删除规则',
            iconCls : 'x-fa fa-trash',
            handler : "deleteRule"
        }]
    },

   columns : [
       { text: '规则编号', dataIndex: 'id', flex: 1 },
       { text: '规则名称', dataIndex: 'name', flex: 1 },
       { text: '文档编号', dataIndex: 'sheetId', flex: 1 },
       { text: '创建人',hidden:true, dataIndex: 'createBy', flex: 1 },
       { text: '创建时间',hidden:true, dataIndex: 'createTime', flex: 1 },
       { text: '最后修改时间',hidden:true, dataIndex: 'modifyTime', flex: 1 },
       { text: '最后修改人',hidden:true, dataIndex: 'modifyBy', flex: 1 },
       { text: '获得授权部门',hidden:true,  dataIndex: 'dep', flex: 1 }
   ],

    dockedItems: [{
        xtype: 'pagingtoolbar',
        bind: {
            store: '{convertStore}'
        },
        dock: 'bottom',
        displayInfo: true
    }]
});
